package com.kzd.gtgame.db;

import androidx.room.Dao;
import androidx.room.Delete;
import androidx.room.Insert;
import androidx.room.OnConflictStrategy;
import androidx.room.Query;
import androidx.room.Update;

import org.jetbrains.annotations.NotNull;

import java.util.List;

@Dao
public interface GameDownloadDao {

    @Insert(onConflict = OnConflictStrategy.REPLACE)
    Long insert(@NotNull GameDownload account);

    @Insert(onConflict = OnConflictStrategy.REPLACE)
    void insert(@NotNull List<GameDownload> accounts);

    @Update(onConflict = OnConflictStrategy.REPLACE)
    void update(@NotNull GameDownload account);

    @Delete
    void delete(@NotNull GameDownload account);

    @Query("DELETE FROM GameDownload")
    void delete();

    @Query("DELETE FROM GameDownload WHERE game_id = :gameId")
    void delete(String gameId);

    @Query("SELECT * FROM GameDownload")
    List<GameDownload> loadAll();

    @Query("SELECT * FROM GameDownload WHERE game_id =:gameId")
    GameDownload selectGameDownloadByGameID(String gameId);


//    @Query("UPDATE GameDownload SET is_ait= :isAit WHERE game_id = :gameId")
//    void upDateChatLastsByAit(boolean isAit, int gameId);

//    @Query("SELECT * FROM CartSelected WHERE shop_id=:shopId")
//    List<CartSelected> selectCartSelectedByShopId(int shopId);
//
//    @Query("SELECT * FROM CartSelected WHERE shop_id=:shopId AND cart_id=:cartId")
//    CartSelected selectCartSelectedByShopIdAndCartId(int shopId, int cartId);

}
